package com.dunshan.data.config;

import com.alibaba.ttl.TransmittableThreadLocal;

import java.io.Serializable;

/**
 * @author dunsshan
 * @program: mall-swarm-new
 * @description: 日志上下文
 * @date 2021-11-14 15:37:59
 */
public class AppContext implements Serializable {

    private static final TransmittableThreadLocal<AppContext> contextdunshan = new TransmittableThreadLocal<>();

    private String flag;

    public static AppContext getContext() {
        return contextdunshan.get();
    }

    public static void setContext(AppContext context) {
        contextdunshan.set(context);
    }

    public static void removeContext() {
        contextdunshan.remove();
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }
}
